/* 
 * File:   BoundingVolume.h
 * Author: brady
 *
 * Created on March 4, 2011, 3:40 PM
 */

#ifndef BOUNDINGVOLUMENODE_H
#define	BOUNDINGVOLUMENODE_H
#include <math.h>
#include <float.h>
#include <vector>
#include "Shape.h"
#include "BoundingBox.h"

using namespace std;

class BoundingVolumeNode : public Shape{
public:
    BoundingVolumeNode();
    BoundingVolumeNode(vector<Shape*>& nodes, int sortBy);
    virtual ~BoundingVolumeNode();
    Shape* GetLeftChild(){return leftChild;}
    Shape* GetRightChild(){return rightChild;}
    //inherited from Shape
    bool TestIntersect(Ray &ray, double tmin, double tmax, HitStruct& hitStruct);
//    const Vector3D SurfaceNormal(Ray &ray);
    void SetShader(Shader* shader);
    Shader* GetShader();
    double GetSortValue(int sortBy);
private:
    int sortBy;
    Shape* leftChild;
    Shape* rightChild;
};

#endif	/* BOUNDINGVOLUMENODE_H */

